﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ZBJF.Warranty.Model.ViewModel.BaseQueryModel;

namespace ZBJF.Warranty.IDAL.IRepositories
{
    public interface IBaseRepository<T> where T : class,new()
    {
        T AddEntities(T entity);
        bool UpdateEntities(T entity);
        bool DeleteEntities(T entity);
        IQueryable<T> LoadEntities(Expression<Func<T, bool>> wherelambda);

        IQueryable<T> LoadPagerEntities<S>(int pageIndex, int pageSize, out int total,
            Expression<Func<T, bool>> whereLambda, List<OrderModelField> orderByExpression); //Expression<Func<T, S>>
        int ExcuteSql(string strSql, SqlParameter[] parameters);
        object ExecuteScalar(string strSql, SqlParameter[] parameters);
        DataTable SqlQuery(string strSql, params SqlParameter[] parameters);

    }
}
